package com.ep.modules.app.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ep.common.utils.PageUtils;
import com.ep.modules.app.dao.AppAuditWorkingPaperMapper;
import com.ep.modules.app.entity.AppAuditWorkingPaper;
import com.ep.modules.app.entity.AppAuditWorkingPaperExample;
import com.ep.modules.app.service.AppAuditWorkingPaperService;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AppAuditWorkingPaperServiceImpl implements AppAuditWorkingPaperService {
    @Autowired
    private AppAuditWorkingPaperMapper appAuditWorkingPaperMapper;

    public PageUtils queryPage(Map<String, Object> params) {
        String searchKey = (String)params.get("searchKey");
        Long searchUserId = (Long)params.get("searchUserId");
        AppAuditWorkingPaperExample example = new AppAuditWorkingPaperExample();
        AppAuditWorkingPaperExample.Criteria criteria = example.createCriteria();
        List<AppAuditWorkingPaper> list = appAuditWorkingPaperMapper.selectByExample(example);
        Page<AppAuditWorkingPaper> page = new Page<>();
        page.setRecords(list);
        return new PageUtils(page);
    }

    public AppAuditWorkingPaper getById(Long id) {
        return appAuditWorkingPaperMapper.selectByPrimaryKey(id.intValue());
    }

    public void save(AppAuditWorkingPaper entity) {

        /////appAuditWorkingPaperMapper.insert(entity);
    }

    public void update(AppAuditWorkingPaper entity) {

        /////appAuditWorkingPaperMapper.updateByPrimaryKeySelective(entity);
    }

    public void deleteBatch(Long[] ids) {
        for (Long id : ids) {
                appAuditWorkingPaperMapper.deleteByPrimaryKey(id.intValue());
        }
    }
}